package com.txzt.gaea.common.enums;

public enum DeviceStatus {

    /**
     * 待维修
     */
    REPAIR(10,"待维修"),
    /**
     * 维修中
     */
    REPAIRING(11,"维修中"),
    /**
     * 已维修
     */
    REPAIRED(12,"已维修"),
    /**
     * 待提交
     */
    SCRAP(20,"待提交"),
    /**
     * 审核中
     */
    SCRAPING(21,"审核中"),
    /**
     * 已报废
     */
    SCRAPED(22,"已报废"),
    ;

    private final Integer code;

    private final String info;

    DeviceStatus(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static String getInfoByCode(Integer code){
        DeviceStatus[] statuses = values();
        for (DeviceStatus status:statuses){
            if (status.getCode().equals(code)) {
                return status.getInfo();
            }
        }
        return "";
    }
}
